/**
 * @description 展示
 */
import React, { useEffect, useState } from "react"

import avatar from '@/assets/img/avator.webp'
import AbIcon from "@/components/DecorateIcons/Ab_Icon"
import GoodListEntry from "@/views/2025/Front/PageWrapper/Components/GoodList"
import CategoryList from "../../Category"


function Recommend({ home }) {

  return (
    <div className={`recommend animate__animated animate__${home.base.recommend_animate}`}>

      {/* 标题 */}
      <div className="title">
        <span className="text">商品推荐</span>
        <span className="subtext">SHANGPIN RECOMMEND</span>
      </div >

      {/* 分类 */}
      <CategoryList limit={home.recommend_category.base.limit} />


      {/* 商品展示。 根据不同type渲染不同样式的组件 */}
      <GoodListEntry base={home.recommend.base} />

      {/* 查看更多 */}
      <div className="more">
        <span className="text">{home.recommend_more.base.text}</span>
        <AbIcon iconName={home.recommend_more.base.icon} className='icon' />
      </div >

      {/* 自定义盒子 */}

    </div >
  )
}

// 获取分类数据
function getCategory(limit) {
  let list = []
  for (let index = 0; index < limit; index++) {
    list.push({
      id: index,
      title: `分类${index + 1}`,
      img: avatar
    })

  }
  return list
}
export default Recommend